import 'package:flutter_test/flutter_test.dart';
import 'package:pasteboard/pasteboard.dart';
import 'package:pasteboard/pasteboard_platform_interface.dart';
import 'package:pasteboard/pasteboard_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockPasteboardPlatform
    with MockPlatformInterfaceMixin
    implements PasteboardPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final PasteboardPlatform initialPlatform = PasteboardPlatform.instance;

  test('$MethodChannelPasteboard is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelPasteboard>());
  });

  test('getPlatformVersion', () async {
    Pasteboard pasteboardPlugin = Pasteboard();
    MockPasteboardPlatform fakePlatform = MockPasteboardPlatform();
    PasteboardPlatform.instance = fakePlatform;

    expect(await pasteboardPlugin.getPlatformVersion(), '42');
  });
}
